<?php

/**
 * photo actions.
 *
 * @package    sfwixet
 * @subpackage photo
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class photoListComponents extends sfComponents
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
	
  public function executeTitle(sfWebRequest $request)
  {

  }
  
  public function executeIndex(sfWebRequest $request)
  {
  	try{
  		$this->album = Doctrine::getTable("Album")->find($request->getParameter("id",$this->getUser()->getGuardUser()->getMainAlbumId()));
  	}
  	catch(Exception $e){
  		
  		$this->album = $this->getUser()->getGuardUser()->getMainAlbum();	
  	}
  	
  	$allowedPhotos = $this->album->getAllowedPhotos($request->getParameter("page",1),$request->getParameter("size",20),$this->getUser());
  	$this->photos = $allowedPhotos['photos'];
  	$this->pagecount = $allowedPhotos['pagecount'];
  }
}
